import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/layout'
Vue.use(VueRouter)

const routes = [
    { path: '/', name: 'maps', component: () => import('../views/maps/index.vue') },
    {
        path: '*',
        name: '404',
        meta: {
            title: '404',
            icon: ''
        },
        component: () => import('@/views/404.vue')
    }
]
// const routes = [
//     {
//         path: '/',
//         name: 'layout',
//         component: Layout,
//         redirect: '/maps',
//         children: [
//             {
//                 path: '/maps',
//                 name: 'maps',
//                 meta: {
//                     title: '地图编辑',
//                     icon: ''
//                 },
//                 component: () => import('../views/maps/index.vue')
//             }
//         ]
//     },
// {
//     path: '*',
//     name: '404',
//     meta: {
//         title: '404',
//         icon: ''
//     },
//     component: () => import('@/views/404.vue')
// }
// ]
const router = new VueRouter({
    base: process.env.BASE_URL,
    mode: 'history',
    routes
})
export default router
